using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Collections;
using FinancialAnalyzer.ToolClasses;
using FinancialAnalyzer.DataBase;


namespace FinancialAnalyzer
{
    public partial class StatisticForm : Form
    {
        public StatisticForm(IList<KeyValuePaar<Month,Double>> source)
        {
            InitializeComponent();
//http://www.codeproject.com/KB/dotnet/newmicrosoftchartcontrol.aspx

            List<String> xNamesList = new List<string>();
            List<Double> yValuesList = new List<Double>();

            foreach (KeyValuePaar<Month,Double> paar in source)
            {
                xNamesList.Add(paar.Key.ToString());
                yValuesList.Add(paar.Value);
            }

            double[] yValues = yValuesList.ToArray();
            string[] xNames = xNamesList.ToArray();
            chart1.Series[0].Points.DataBindXY(xNames, yValues);
            
        }

        
        private void StatisticForm_Load(object sender, EventArgs e)
        {
            
        }

        private void StatisticForm_Resize(object sender, EventArgs e)
        {
           
        }

    }
}